﻿@using FikriKibar.Globalization
@using FikriKibar.UI.WebCommon.Helpers
@using FikriKibar.Entities.Composite.ContentCategoryModels
@model UpdateModel
@{
    ViewBag.Title = Resources.Update;
    Layout = "~/Views/Shared/ContentLayout.cshtml";
}


<div class="container-fluid">
    <div class="row">
        <div class="col-lg-12">
            <h1 class="page-header">@Resources.ContentCategoryManagement</h1>
        </div>
    </div>
    <div class="row">

        <div class="col-lg-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    @Resources.Update
                </div>
                <div class="panel-body">
                    @using (Html.BeginForm("Update", "ContentCategory", FormMethod.Post, new { @role = "form" }))
                    {

                        <div class="form-group">
                            <label class="control-label" for="SelectedLanguageCode">@Resources.Language</label>
                            @Html.DropDownListFor(m => m.SelectedLanguageCode, new SelectList(Model.LanguageList, "LanguageCode", "LanguageName", Model.SelectedLanguageCode), new { @class = "form-control UpdateSelectedLanguageCode" })
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="SelectedContentTypeId">@Resources.ContentType</label>
                            @Html.FikriKibarDropDownListFor(m => m.SelectedContentTypeId, new SelectList(Model.ContentTypeList, "ContentTypeId", "ContentTypeName", Model.SelectedContentTypeId), new { @class = "form-control" })
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="ContentCategoryLanguageLine_ContentCategoryName">@Resources.Name</label>
                            @Html.FikriKibarTextBoxFor(m => m.Item.ContentCategoryName, new { @class = "form-control" })
                            @Html.ValidationMessageFor(m => m.Item.ContentCategoryName)
                        </div>

                        <div class="form-group">
                            <label class="control-label" for="ContentCategoryLanguageLine_ContentCategoryDescription">@Resources.Description</label>
                            @Html.TextAreaFor(m => m.Item.ContentCategoryDescription, new {@class = "form-control"})
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="ContentCategoryLanguageLine_PublishBeginDate">@Resources.PublishBeginDate</label>
                            @Html.FikriKibarTextBoxFor(m => m.Item.PublishBeginDate, new { @class = "form-control datepicker" })
                            @Html.ValidationMessageFor(m => m.Item.PublishBeginDate)
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="ContentCategoryLanguageLine_PublishEndDate">@Resources.PublishEndDate</label>
                            @Html.FikriKibarTextBoxFor(m => m.Item.PublishEndDate, new {@class = "form-control datepicker"})
                            @Html.ValidationMessageFor(m => m.Item.PublishEndDate)
                        </div>

                        <div class="form-group">
                            <label class="control-label" for="User_CreateDate">@Resources.CreateDate</label>
                            <input type="text" value="@Model.Item.CreateDate.ToString("dd/MM/yyyy HH:mm:ss")" class="form-control" disabled="disabled" />
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="User_User_CreatedBy">@Resources.CreatedBy</label>
                            @Html.HiddenFor(m => m.Item.CreatedBy)

                            @Html.FikriKibarTextBoxFor(m => m.Item.User_CreatedBy.FullName, new { @class = "form-control", @placeholder = Resources.CreatedBy, @disabled = "disabled" })


                        </div>
                        <div class="form-group">
                            <label class="control-label" for="User_UpdateDate">@Resources.UpdateDate</label>

                            <input type="text" value="@Model.Item.UpdateDate.ToString("dd/MM/yyyy HH:mm:ss")" class="form-control" disabled="disabled" />
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="User_User_UpdatedBy">@Resources.UpdatedBy</label>
                            @Html.FikriKibarTextBoxFor(m => m.Item.User_UpdatedBy.FullName, new { @class = "form-control", @placeholder = Resources.CreatedBy, @disabled = "disabled" })


                        </div>


                        <div class="form-group">
                            <div class="checkbox">
                                <label>
                                    @Html.CheckBoxFor(m => m.Item.IsApproved) @Resources.Approve
                                </label>
                            </div>
                        </div>
                        @Html.FikriKibarHiddenFor(m => m.ContentCategoryId)
                        <button class="btn btn-primary"><i class="fa fa-save"></i>&nbsp;@Resources.Save</button>
                        <a href="#" class="btn btn-danger DeleteButton" data-confirm-href="@Url.Action("Delete", "ContentCategory", new {id = Model.ContentCategoryId, language=Model.SelectedLanguageCode})" data-confirm-title="@Resources.AreYouSure" data-confirm-message="@Resources.AreYouSureDelete" data-confirm-ok="@Resources.Yes" data-confirm-cancel="@Resources.No"><i class="fa fa-remove fa-fw"></i> @Resources.Delete</a>
                    }
                </div>

            </div>

            <div class="row">
                <div class="col-lg-12 text-center">
                    @Html.FikriKibarAlertFor(m => m.Message, "div", Model.Message, new { @class = "alert alert-danger" })
                </div>
            </div>
        </div>
    </div>
</div>


